package com.iptv.grape.event.data;

import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.event.msg.VodWindowDataArgs;
import com.iptv.grape.util.AppLog;
import com.iptv.grape.util.CommUtil;

import java.util.Date;

// 数据采集点播参数对象
public class VodData {
    // 栏目ID
    private String columnID;
    // 栏目名称
    private String columnName;
    // 影片ID
    private String assetID;
    // 影片名称
    private String filmName;
    // 当前播放集数
    private String episodes;
    // VOD集数
    private String vodEpisodes;
    // 点播节目总时长
    private int VodTime;
    // 点播节目操作类型(0：播放;1：快进;2：快退;3：暂停)
    private String vodOperateType;

    // 播放速率(无倍速，此字段为空)
    private String pace;

    // 进入点播方式（0：搜索  1：推荐位 2：栏目导流 3：历史记录 4：收藏 5：关联推荐 6：连播 7：其他方式）
    private String enterType;
    // 影片类型（0：电影；1：电视剧；2：综艺；3：少儿；4：教育；5：生活；6：体育；7：纪实；8：音乐；9：财经；10：自制；11：美剧；12：其他）
    private String filmType;
    // 节目操作时间
    //private String startTime;
    // 进入退出（0：进入；1：按键退出；2：播放完毕自动退出）
    private String state;
    // 产品ID
    private String productID;
    // 供应商spid
    private String spID;
    // 预留1
    private String reserve1;
    // 预留2
    private String reserve2;


    private static VodData curVodData = null;


    public static VodData getCurVodData() {
        return curVodData;
    }

    public static void create(VodWindowDataArgs argsData){
        VodData vodData = new VodData();
        vodData.columnID = argsData.getData().getColumnID();
        vodData.columnName = argsData.getData().getColumnName();
        vodData.assetID = argsData.getData().getCode();
        vodData.filmName = argsData.getData().getName();
        vodData.episodes = (argsData.getCurIndex() + 1) + "";
        vodData.vodEpisodes = argsData.getSubAssetList().size() + "";
        vodData.VodTime = 0;
        //AppLog.getCurLog().out(GrapeContext.curGrapeContext().getCurMediaPlayer().getDuration() + "");
        vodData.vodOperateType = "0";
        vodData.pace = "";
        vodData.enterType =  argsData.getData().getEnterType();
        vodData.filmType = argsData.getData().getType();
        //vodData.startTime = CommUtil.formatDate(new Date(),"yyyyMMddHHmmss");
        vodData.state = "0";
        vodData.productID = "";
        vodData.spID = argsData.getData().getSpCode();
        curVodData = vodData;
    }

    public String getPace() {
        return pace;
    }

    public void setPace(String pace) {
        this.pace = pace;
    }

    public String getColumnID() {
        return columnID;
    }

    public void setColumnID(String columnID) {
        this.columnID = columnID;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getAssetID() {
        return assetID;
    }

    public void setAssetID(String assetID) {
        this.assetID = assetID;
    }

    public String getFilmName() {
        return filmName;
    }

    public void setFilmName(String filmName) {
        this.filmName = filmName;
    }

    public String getEpisodes() {
        return episodes;
    }

    public void setEpisodes(String episodes) {
        this.episodes = episodes;
    }

    public String getVodEpisodes() {
        return vodEpisodes;
    }

    public void setVodEpisodes(String vodEpisodes) {
        this.vodEpisodes = vodEpisodes;
    }

    public int getVodTime() {
        return VodTime;
    }

    public void setVodTime(int vodTime) {
        VodTime = vodTime;
    }

    public String getVodOperateType() {
        return vodOperateType;
    }

    public void setVodOperateType(String vodOperateType) {
        this.vodOperateType = vodOperateType;
    }

    public String getEnterType() {
        return enterType;
    }

    public void setEnterType(String enterType) {
        this.enterType = enterType;
    }

    public String getFilmType() {
        return filmType;
    }

    public void setFilmType(String filmType) {
        this.filmType = filmType;
    }

    public String getStartTime() {
        return CommUtil.formatDate(new Date(),"yyyyMMddHHmmss");
    }



    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getProductID() {
        return productID;
    }

    public void setProductID(String productID) {
        this.productID = productID;
    }

    public String getSpID() {
        return spID;
    }

    public void setSpID(String spID) {
        this.spID = spID;
    }

    public String getReserve1() {
        return reserve1;
    }

    public void setReserve1(String reserve1) {
        this.reserve1 = reserve1;
    }

    public String getReserve2() {
        return reserve2;
    }

    public void setReserve2(String reserve2) {
        this.reserve2 = reserve2;
    }
}
